'use strict';
angular.module('nec-admin.login')
    .service('loginService', ['$http', 'serverUrl', function ($http, serverUrl) {
        var service = this;

        service.login = function (username, password) {
            return $http({
                url: serverUrl + '/user',
                method: 'GET',
                headers: {
                    'Authorization': 'Basic ' + btoa(username + ':' + password)
                }
            }).then(function (resp) {
                return resp.data;
            });
        };
    }]);
